﻿using Ecommerce.API.Application.Command.LeaveCommand;
using Ecommerce.Domain.Holiday;
using Ecommerce.Services.Leaves;
using MediatR;

namespace Ecommerce.API.Application.CommandHandlers.LeaveHandler
{
    public class PartmentcommandHandler : IRequestHandler<Partmentcommand, List<Partment>>
    {
        private readonly ILeaveServices services;

        public PartmentcommandHandler(ILeaveServices services)
        {
            this.services = services;
        }

        public Task<List<Partment>> Handle(Partmentcommand request, CancellationToken cancellationToken)
        {
            return services.GetPartments();
        }
    }
}
